<h3>Purchase</h3>
<table>
<tr>
<td><a href="jascript:void(0);">Choose</a></td>
<td width="100px"></td>
<td><a  href="jascript:void(0);">Confirm</a></td>
<td width="100px"></td>
<td><a href="jascript:void(0);">Pay</a></td>
</tr>
</table>
<br /><br />
<form id="myForm" method="post">
<input type="hidden" name="orderAmount" id="orderAmount" <?if(isset($_SESSION['cart']['price'])){?>value="<?echo $_SESSION['cart']['price'];?>"<?}?>/>
<table>
<tr><td><H4>Packages</h4></td></tr>
<tr>
<td>
<? echo $_SESSION['cart']['package_name'];?>
</td>
<td width="50px">
</td>
<td>
<? echo $_SESSION['cart']['price'];?>
</td>
<td width="50px">
</td>
</tr>
</table>
<br /><br />
<table>
<tr><td><H4>Personal Detailes</h4></td></tr>
<tr>
<td>
Email Id
</td>
<td>
:
</td>
<td>
<input type="text" name="emailId" id="emailId"/><span id="erroremailId" style="color:red"></span>
</td>
</tr>

<tr>
<td>
Name
</td>
<td>
:
</td>
<td>
<input type="text" name="name" id="name"/><span id="errorname" style="color:red"></span>
</td>
</tr>

<tr>
<td>
Mobile No
</td>
<td>
:
</td>
<td>
<input type="text" name="mobileNo" id="mobileNo"/><span id="errormobileNo" style="color:red"></span>
</td>
</tr>
</table>
<br /><br />
<table>
<tr><td><H4>Shipping Address</h4></td></tr>
<tr>
<td>
Address
</td>
<td>
:
</td>
<td>
<textarea id="address" name="address"></textarea><span id="erroraddress" style="color:red"></span>
</td>
</tr>

<tr>
<td>
City
</td>
<td>
:
</td>
<td>
<input type="text" name="city" id="city"/><span id="errorcity" style="color:red"></span>
</td>
</tr>

<tr>
<td>
State
</td>
<td>
:
</td>
<td>
<input type="text" name="state" id="state"/><span id="errorstate" style="color:red"></span>
</td>
</tr>
</table>
<br />
<p style="margin-left:400px"><a href="javascript:void(0);" onclick="formSubmit()">Continue</p>
</form>
<script>
	function formSubmit(){
	var flag=true;
	
	if($('#emailId').val()==""){		
		$('#erroremailId').html('*emailId Required');
		flag=false;
	}else{
		$('#erroremailId').html('');
	}
	
	if($('#name').val()==""){
		$('#errorname').html('');
		$('#errorname').html('*name Required');
		flag=false;
	}else{
		$('#errorname').html('');
	}
	
	if($('#mobileNo').val()==""){
		$('#errormobileNo').html('*mobileNo Required');
		flag=false;
	}else{
		$('#errormobileNo').html('');
	}
	
	if($('#address').val()==""){
		$('#erroraddress').html('*address Required');
		flag=false;
	}else{
		$('#erroraddress').html('');
	}
	
	if($('#city').val()==""){
		$('#errorcity').html('*city Required');
		flag=false;
	}else{
		$('#errorcity').html('');
	}
	
	if($('#state').val()==""){
		$('#errorstate').html('*state Required');
		flag=false;
	}else{
		$('#errorstate').html('');
	}
	
	if(flag==false){ 
		return false;
	}else{	
		$.ajax({
			type:	'POST',
			url:   	'/order',
			data:	$( "#myForm" ).serialize(),
			success: function(data){ 
				window.location="/pay";
			}
		});
	}	
}
</script>